﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EbayQueryExpert
{
    public partial class CompareApiUrlForm : Form
    {
        public CompareApiUrlForm()
        {
            InitializeComponent();
        }

        private void CompareApiUrlForm_Load(object sender, EventArgs e)
        {
            button1.Select();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Dictionary<int, string> dUrls = new Dictionary<int, string>();
            Dictionary<int, string> dDescs = new Dictionary<int, string>();
            string[] urls = textBox1.Text.Split('\n');
            foreach (string u in urls)
            {
                string[] l = u.Replace("- ", "|").Split('|');
                int num = int.Parse(l[0]);
                string url = l[1];
                dUrls.Add(num, url);
            }
            string[] descs = textBox2.Text.Split('\n');
            foreach (string d in descs)
            {
                string[] l = d.Replace("- ", "|").Split('|');
                int num = int.Parse(l[0]);
                string desc = l[1];
                dDescs.Add(num, desc);
            }
            new TestCompareForm(dUrls, dDescs).ShowDialog();
        }
    }
}
